<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/13
 * Time: 15:21
 * used to study route and response
 */

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Laravel\Lumen\Routing\Controller as BaseController;

class RouteController extends BaseController
{
    // redirect route
    public function arrow(Request $request){
        return redirect()->route('route_arrow');
    }

    // redirect point
    public function point(Request $request){
        echo "hello world";
    }

    // route download
    public function down(){
        $file = storage_path().'/uploads/1460939432153.pdf';
        return response()->download($file,"木兰将.pdf");
    }

    public function write_file(){
        $this->email = "454545@qq.com";
        $filename = storage_path()."/logs/jobs.log";
        $content = $this->email."\n";
        file_put_contents($filename,$content,FILE_APPEND);
    }
}